export default {
	data() {
		return {
			curId: 0,
			enclosureList: [], //课程资料信息
			curriculum: {}, //新闻信息
			portalConfigList: [], //友情链接信息
			fatherIndex: 0, //一级菜单index
		}
	},
	updated:function(){
		if(this.getParamValue("fatherIndex")){
			this.fatherIndex=this.getParamValue("fatherIndex");
		}
		if(this.getParamValue("childIndex")){
			this.childIndex=this.getParamValue("childIndex");
		}
	},
	created() { //调用方法
		let that = this;
		let uuid = that.get("courseDetailsUuid");
			//初始化友情连接信息
		//初始化课程信息
		that.$post(
				that.urls.getCurriculum, {
					"uuid": uuid
				}
			)
			.then(function(res) {
				if(res.success) {
					that.curriculum = res.data;
					let enclosure = res.data.enclosure;
					let enclosureList = [];
					if(enclosure != null) {
						let enclosures = enclosure.split(";");
						for(var i = 0, len = enclosures.length; i < len; i++) {
							enclosureList.push({
								"name": that.getFileName(enclosures[i]),
								"url": enclosures[i]
							});
						}
					}
					that.enclosureList = enclosureList;
				}
			})
				that.$post(
				that.urls.getAllPortalConfigList, {
					"type": 1
				}
			)
			.then(function(res) {
				if(res.success) {
					that.portalConfigList = res.data;
				}
			})
	},
	mounted() {},
	methods: { //写函数方法
		//用户下拉信息鼠标事件
		showUl: function() {
			$(".wkp-right>div>ul").css("display", "block");
		},
		leaveDiv: function() {
			$(".wkp-right>div>ul").css("display", "none");
		},
		//下载资源
		downloadResources: function(filePath) {
			if(filePath != null && filePath != "") {
				window.location.href = this.urls.download + "?path=" + filePath;
			}
		}
	}
}
